<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>登录页面</title>
</head>

<body>
  <script>
    while (true) {
      var userName = prompt("请输入用户名");
      var password = prompt("请输入密码");
      if (userName == "admin" & password == "123456") {
        document.write("<h2>恭喜您！登陆成功</h2><br><a href='detaile.html'>点击跳转</a>");
        break;
      } else {
        alert("用户名或密码错误！请重新输入");
        continue;
      }

    }

  </script>

</body>

</html>